﻿using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;

namespace MVCForum.Web.Identity.EF.Entities {

	public class User : IUser {

		public User() {
			this.Id = Guid.NewGuid().ToString();

			this.Claims = new List<UserClaim>();
			this.Logins = new List<UserLogin>();
			this.Roles = new List<UserRole>();
		}

		public User(String userName)
			: this() {
			this.UserName = userName;
		}

		public String Id { get; set; }
		public String UserName { get; set; }
		public String PasswordHash { get; set; }
		public String SecurityStamp { get; set; }

		public String EmailAddress { get; set; }
		public DateTime Created { get; set; }
		public DateTime LastVisit { get; set; }
		public Boolean Locked { get; set; }
		public Boolean Approved { get; set; }
		public DateTime LastPasswordFailure { get; set; }
		public Int32 PasswordFailures { get; set; }
		public DateTime LastLockout { get; set; }

		public virtual ICollection<UserClaim> Claims { get; set; }
		public virtual ICollection<UserLogin> Logins { get; set; }
		public virtual ICollection<UserRole> Roles { get; set; }
	}
}